package cn.ilikes.apps.collect.pojos;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import cn.ilikes.tools.nosql.jpa.annotations.IndexColumn;
import cn.ilikes.tools.nosql.jpa.annotations.IndexColumn.Index;
import cn.ilikes.tools.nosql.jpa.annotations.IndexColumn.Store;

@Entity
@Table(name = "ilikes_my_collect_folder", schema = "ilikes_collect")
public class IlikesMyfolder {

	@Id
	@IndexColumn(index = Index.not_analyzed, name = "id", store = Store.no)
	private String uuid;

	@Column(name = "folder@name")
	@IndexColumn(index = Index.analyzed, name = "name", store = Store.no)
	private String name;

	@ManyToOne
	@JoinColumn(name = "folder@parentsid")
	private IlikesMyfolder parents;

	@OneToMany(cascade = CascadeType.PERSIST, mappedBy = "parents", fetch = FetchType.LAZY)
	private List<IlikesMyfolder> childs;

	@ManyToOne
	@JoinColumn(name = "folder@likesusersid")
	private IlikesUsers iikesUsers;

	@OneToMany(cascade = CascadeType.PERSIST, mappedBy = "likesMyfolder", fetch = FetchType.LAZY)
	private List<IlikesMyCollects> likesMyCollectses;

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public IlikesMyfolder getParents() {
		return parents;
	}

	public void setParents(IlikesMyfolder parents) {
		this.parents = parents;
	}

	public List<IlikesMyfolder> getChilds() {
		return childs;
	}

	public void setChilds(List<IlikesMyfolder> childs) {
		this.childs = childs;
	}

	public IlikesUsers getIikesUsers() {
		return iikesUsers;
	}

	public void setIikesUsers(IlikesUsers iikesUsers) {
		this.iikesUsers = iikesUsers;
	}

	public List<IlikesMyCollects> getLikesMyCollectses() {
		return likesMyCollectses;
	}

	public void setLikesMyCollectses(List<IlikesMyCollects> likesMyCollectses) {
		this.likesMyCollectses = likesMyCollectses;
	}

}
